#version 450 core
#extension GL_NV_uniform_buffer_std430_layout : enable

layout(location = 0) in vec3 inPos;
layout(location = 1) in vec3 inNormal;
layout(location = 0) out vec3 normal;
layout(location = 1) out vec3 fragPos;
struct Scene {
    mat4 viewProjectionMatrix;
    vec3 cameraDir;
    vec3 cameraPos;
};
layout(binding = 0, std140) uniform SceneBlock {
    Scene scene;
};
struct Transform {
    mat4 modelMatrix;
    mat4 normalMatrix;
};
layout(binding = 1, std140) uniform TransformBlock {
    Transform transform;
};
void main() {
    const mat4 worldMatrix = scene.viewProjectionMatrix * transform.modelMatrix;
    gl_Position = worldMatrix * vec4(inPos, 1.0f);
    normal = vec3(transform.normalMatrix * vec4(inNormal, 1.0f));
    fragPos = vec3(transform.modelMatrix * vec4(inPos, 1.0f));
}
